package com.server.impl;

import com.dao.product.ProductMapper;
import com.pojo.Admin;
import com.pojo.Member;
import com.pojo.Product;
import com.server.ProductService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;
import java.util.Date;
import java.util.List;

@Service
public class ProductServiceImpl implements ProductService {
    @Resource
    ProductMapper productMapper;

    @Override
    public List<Product> findproduct(String product_name){return productMapper.findproduct(product_name);}

    @Override
    public int addByID(int product_id) {
        return productMapper.addByID(product_id);
    }

    @Override
    public Product selectProductById(int product_id) {
        return productMapper.selectProductById(product_id);
    }

    @Override
    public List<Product> getAdd(int product_id, String description) {
        return productMapper.getAdd(product_id,description);
    }

    @Override
    public List<Product> getproductList() {
        return productMapper.getproductList();
    }

    @Override
    public List<Product> getproducandproductimageList() { return productMapper.getproducandproductimgtList(); }

    @Override
    public int updateproduct(int product_id,String product_name,String product_s_price,String product_price){
        return productMapper.updateproduct(product_id, product_name, product_s_price, product_price);
    }

    @Override
    public int addproduct(int product_id, String product_name, String product_s_price, String product_price, Date product_create_time) {
        return productMapper.addproduct(product_id, product_name, product_s_price, product_price,product_create_time);
    }

    @Override
    public int delproduct(int product_id) {
        return productMapper.delproduct(product_id);
    }
}
